{% extends 'layout.html' %}

{% load static %}

{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-3.4.1-dist/css/bootstrap-datetimepicker.min.css' %}">
{% endblock %}

{% block content %}

    <div class="panel panel-default">
        <div class="panel-heading">新建用户</div>
        <div class="panel-body">
            <form method="post">
                {% csrf_token %}
                <div class="form-group">
                    <label>姓名</label>
                    <input type="text" class="form-control" name="add_name" placeholder="姓名">
                </div>

                <div class="form-group">
                    <label>密码</label>
                    <input type="text" class="form-control" name="add_password" placeholder="密码">
                </div>

                <div class="form-group">
                    <label>年龄</label>
                    <input type="text" class="form-control" name="add_age" placeholder="年龄">
                </div>

                <div class="form-gdroup">
                    <label>余额</label>
                    <input type="text" class="form-control" name="add_account" placeholder="余额">
                </div>

                <div class="form-group">
                    <label>入职时间</label>
                    <input type="text" class="form-control" name="add_time" placeholder="入职时间" autocomplete="off"
                           id="input_date">
                </div>

                <div class="form-group">
                    <label>性别</label>
                    <select name="add_gender" class="form-control">
                        {% for item in gender_choices %}
                            <option value="{{ item.0 }}">{{ item.1 }}</option>
                        {% endfor %}
                    </select>
                </div>

                <div class="form-group">
                    <label>所属部门</label>
                    <select name="add_depart" class="form-control">
                        {% for item in depart_list %}
                            <option value="{{ item.id }}">{{ item.title }}</option>
                        {% endfor %}
                    </select>
                </div>

                <button type="submit" class="btn btn-primary">提 交</button>

            </form>
        </div>
    </div>
{% endblock %}

{% block js %}
    <script src="{% static 'plugins/bootstrap-3.4.1-dist/js/bootstrap-datetimepicker.min.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-3.4.1-dist/js/bootstrap-datetimepicker.zh-CN.js' %}"></script>
    <script>
        $(function () {
            $("#input_date").datetimepicker({
                format: 'yyyy-mm-dd',
                language: 'zh-CN',
                minView: 'month',//设置时间选择为年月日 去掉时分秒选择
                autoclose: true,//当选择一个日期之后是否立即关闭此日期时间选择器。
                todayHighlight: 1  //如果为true, 高亮当前日期
            })
        });
    </script>

{% endblock %}